package com.sansui.admin.core.model;

import java.io.Serializable;

import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sansui.admin.core.groups.ResourcesAdd;
import com.sansui.admin.core.groups.ResourcesUpdate;

import lombok.Data;

@Data
@Table(name = "system_resources")
public class Resources implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4125580367922291000L;
	@NotNull(groups = { ResourcesUpdate.class }, message = "id不能为空")
	private String id;
	@NotNull(groups = { ResourcesUpdate.class, ResourcesAdd.class }, message = "pid不能为空")
	private String pid;
	@NotNull(groups = { ResourcesUpdate.class, ResourcesAdd.class }, message = "name不能为空")
	private String name;
	@NotNull(groups = { ResourcesUpdate.class, ResourcesAdd.class }, message = "url不能为空")
	private String url;
	@NotNull(groups = { ResourcesUpdate.class, ResourcesAdd.class }, message = "type不能为空")
	private String type;
	@NotNull(groups = { ResourcesUpdate.class, ResourcesAdd.class }, message = "sort不能为空")
	private String sort;

	public Resources(String id, String pid, String name, String url, String type, String sort) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.url = url;
		this.type = type;
		this.sort = sort;
	}

	public Resources() {

	}
}